<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Setup.aspx.cs" Inherits="MOM.Setup" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>MOM Setup</title>
    <style type="text/css">
		@import url(Css/Mom.css);
		@import url(Css/themes/green.css);
    </style>
    <script type="text/javascript" language="javascript" src="Js/jquery-1.2.6.js"></script>
    <script type="text/javascript">
		function Synchronize()
		{
			$.get("DB/Sync.aspx", {a:"Full"}, Sync_Callback);
		}
		
		function Sync_Callback()
		{
			window.location = "Default.aspx";
		}
    </script>
</head>
<body style="padding-top:20px;">
    <form id="form1" runat="server">
		<div class="DropShadow" style="width:80%;margin:0 auto;">
			<div class="Box">
				<div class="P10">
					<div style="width:70%;margin:0 auto;">				
					<asp:PlaceHolder ID="plhLang" runat="server">
						<h1 style="color:#FFFFFF">1/4 Select language</h1>
						<asp:DropDownList id="ddlLang" runat="server"></asp:DropDownList>
						<asp:Button ID="btnLang" OnClick="LangSet_Click" Text="Select" runat="server" />
					</asp:PlaceHolder>
					
					<asp:PlaceHolder ID="plhUser" Visible="False" runat="server">
						<h1 style="color:#FFFFFF;">2/4 Create Account</h1>
						<b>Username:</b><br />
						<asp:TextBox ID="txtUsername" runat="server"></asp:TextBox>
						<br /><br />
						<b>Password:</b><br />
						<asp:TextBox ID="txtPassword" TextMode="password" runat="server"></asp:TextBox><br />
						<asp:Button ID="btnUser" Text="Create account" OnClick="UserSave_Click" runat="server" />
					</asp:PlaceHolder>
					
					<asp:PlaceHolder ID="plhAdv" Visible="false" runat="server">
						<h1 style="color:#FFFFFF;">3/4 Application settings</h1>
						Leave the default value if you don't understand what it is.<br />
						<br />
						<table width="500" border="0">
							<tr><td>Enable share switching<br /><span style="font-size:90%">If you do not need to switch multiple shares on and off and you have lots of files you can disable this to gain some performance.</span></td><td valign="top"><asp:CheckBox ID="cbShareSwitching" Checked="true" runat="server" /></td></tr>
							<tr><td>Check file dates on synchronization<br /><span style="font-size:90%;">Only enable if you are modfying (not counting adding files) id3-tags often. This will slow down synchronization.</span></td><td valign="top"><asp:CheckBox ID="cbFileCheck" Checked="false" runat="server" /></td></tr>
							<tr><td>Cache Lyrics<br /><span style="font-size:90%">If enabled viewed lyrics will be saved to database and you'll be able to search among them. This will take up extra hard drive space.</span></td><td valign="top"><asp:CheckBox ID="cbCacheLyrics" Checked="true" runat="server" /></td></tr>
														
							<tr><td colspan="2"><br /><b>Output caching</b></td></tr>
							<tr><td>Enabled<br /><span style="font-size:90%;">Output caching is only used on artist and album listings, really don't know why you'd want to disable it</span></td><td valign="top"><asp:CheckBox ID="cbOutputCache" Checked="true" runat="server" /></td></tr>
							<tr><td>Expires after</td><td><asp:TextBox ID="txtOutputCache" Width="20" Text="12" runat="server"></asp:TextBox> hours</td></tr>							
							
							<tr><td colspan="2"><br /><b>Shared playlist</b></td></tr>
							<tr>
								<td>Remove track..<br /><span style="font-size:90%;">Tells when to remove a track when using the shared playlist.</span></td>
								<td valign="top">
									<asp:DropDownList ID="ddlShared" runat="server">
										<asp:ListItem Text="When Played" Value="Played"></asp:ListItem>
										<asp:ListItem Text="After a certain time" Value="Time"></asp:ListItem>
										<asp:ListItem Text="Manually" Value="Manual"></asp:ListItem>
									</asp:DropDownList>
								</td>
							</tr>
							<tr><td>Time to remain in playlist<br />(if selected above)</td><td valign="top"><asp:TextBox ID="txtShared" Width="20" Text="3" runat="server"></asp:TextBox> hours</td></tr>						
						</table>
						<br />
						<asp:Button ID="btnAdv" Text="Save settings" OnClick="Advanced_Click" runat="server" />
						<br />
					</asp:PlaceHolder>
					
					<asp:PlaceHolder ID="plhMp3" Visible="false" runat="server">
						<h1 style="color:#FFFFFF;">4/4 Add Music</h1>
						<b>Name of share</b><br />
						<asp:TextBox ID="txtShareName" runat="server"></asp:TextBox>
						<b>Path to music folder (relative to the server)</b><br />
						<asp:TextBox ID="txtPath" runat="server"></asp:TextBox><br />
						<asp:Button ID="btnMusic" Text="Add music" OnClick="Synch_Click" runat="server" />	
					</asp:PlaceHolder>
					
					<asp:PlaceHolder ID="plhSync" Visible="false" runat="server">
						<img src="Images/loading_setup.gif" id="SetupLoad" width="150" height="150" style="display:block;margin:0 auto;margin-bottom:20px;" />
						Adding music to database. This can take a long time, about 2 minutes per 1000 songs.
					</asp:PlaceHolder>
					</div>					
				</div>
			</div>
		</div>
    </form>
</body>
</html>
